import { useEffect, useState } from 'react'
import './DialogBase.scss'
function DialogBase(props) {
  // const [title, setTitle] = useState('ddsdfdfds')
  useEffect(() => {
    console.log('DialogBase')
  }, [])
  const closeEvent = () => {
    props.onCloseClick()
  }

  return (
    <>
      <div class="dialog">
        <div class="dialog-header">
          <div class="dialog-header-title">{props.title}</div>
          <div class="dialog-header-close" onClick={closeEvent}>
            x
          </div>
        </div>
        <div class="dialog-content">
          { props.children}
        </div>
      </div>
    </>
  )
}

export default DialogBase
